<?xml version="1.0" encoding="ISO-8859-1"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:s="http://jboss.com/products/seam/taglib"
  template="/WEB-INF/templates/template.xhtml"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:rich="http://richfaces.org/rich">
  
  <ui:define name="head">
  </ui:define>
<ui:define name="editPerfil">
   <center >
	<h:outputText value="ABM de Perfiles"  styleClass="tituloabm"/>
   <br />
	<br /> 	
   <div class ="divabm">
   
   <h:form  id = "saveperfilform" rendered="#{appUser.userLogin != null}">
    	<h:panelGrid columns="1">
    		<h:outputText value="#{messages.editprofileuser}" styleClass="outputcommon" />
    	</h:panelGrid>
    	<h:panelGrid columns= "3">
    		<h:outputText value="#{messages.editdescripcion}" styleClass="outputcommonbold" />
    		<h:inputText id = "descripcion" value="#{profileCtrl.profileSelected.descripcion}"  />
    		<h:message for="descripcion" style="color:red" />
    	</h:panelGrid>	
    	<h:panelGrid columns= "2">	
    		<h:outputText value="#{messages.editactive}" styleClass="outputcommonbold"/>
    		<h:selectBooleanCheckbox value="#{profileCtrl.profileSelected.activo}" />
    	</h:panelGrid>
    	<br />
    	<h:panelGrid columns="1" columnClasses="top, top">
        	<rich:pickList value="#{profileCtrl.profileSelected.roles}" converter = "#{roladapter.converter}" listsHeight = "5"
        		copyTitle = "Agregar" copyAllControlLabel = "Agregar todos" removeAllTitle = "Sacar todos" removeControlLabel ="Sacar todos" > 
            	<f:selectItems value="#{roladapter.items}"/>
        	</rich:pickList>
        </h:panelGrid>
		<br />
      	<h:panelGrid columns="3">
      			<h:commandLink action="admin-profiles.jsf" styleClass="commandLink">
    			  	<h:commandButton action="#{profileCtrl.clearData}" value ="Volver" styleClass="volverbutton" >
    			  		<f:ajax  event="click" reRender="saveperfilform" execute="@form" immediate="true" />
    			  	</h:commandButton>
    			 </h:commandLink> 	
    		   <h:commandButton action="#{profileCtrl.removePerfil}" value="Eliminar" styleClass="eliminarbutton"  rendered="#{profileCtrl.profileSelected.id != null}"/>
	   		   <h:commandButton action="#{profileCtrl.savePerfil}" value ="Guardar" styleClass="guardarbutton"  />
    	</h:panelGrid>
    	<h:panelGrid columns="1">
    			<h:outputText id="savesuccessmsg" value="#{messages.savesuccess}" rendered = "#{profileCtrl.saveSuccess}"  style="FONT-WEIGHT: bold; COLOR: #ff0000;font-family: Arial;"/>
    			<h:outputText id="deletesuccessmsg" value="#{messages.deletesuccess}" rendered = "#{profileCtrl.deleteSuccess}"  style="FONT-WEIGHT: bold; COLOR: #ff0000;font-family: Arial;"/>
    	</h:panelGrid>
    	
    </h:form>
	
	</div>
	</center>
	</ui:define>
<ui:define name="body">
 </ui:define>    	
 </ui:composition>

